<%@ page import="bcared.*" %>
<%@ include file="header.jsp"%>

<h2>Equipment details</h2>

<%
int equipmentID = Integer.parseInt(request.getParameter("equipmentId"));
Equipment c = new Equipment(equipmentID) ;
//Equipment c = new Equipment(500) ;

// c.getCustomerDetails();

String outOfServiceDate = c.getOutServiceDate() ;
if ( null == outOfServiceDate )
 { outOfServiceDate = "" ; }
%>				 

  &nbsp;&nbsp;
<form name="form1" action="customerhome.jsp" method="post" > 

 <table width="70%" border="0" >
<tr> 
  <td style="text-align:right;"><strong>Product Name:</strong></td>
  <td ><input value="<%=c.getProductName() %>" name="productName" type="text" size="40" maxlength="45" disabled /> </td>
</tr> 
<tr> 
  <td style="text-align:right;"><strong>Equipment ID:</strong></td>
  <td ><input value="<%=c.getEquipmentID() %>" name="equipmentID" type="text" size="15" maxlength="45" disabled /> </td>
</tr>
<tr>
  <td style="text-align:right;"><strong>Serial Number:</strong></td> 
  <td><input value="<%=c.getSerialNumber()%>" name="serialNumber" type="text" size="40" maxlength="45" disabled ></td>
</tr>
<tr>
  <td style="text-align:right;"><strong>Location ID:</strong></td>
  <td><input value="<%=c.getLocationID()%>" name="locationID" type="text" size="40" maxlength="45" disabled ></td>
</tr>
<tr>  
  <td style="text-align:right;"><strong>Room:</strong></td>
  <td><input value="<%=c.getRoom()%>" name="room" type="text" size="40" maxlength="20" disabled ></td>
</tr>
<tr> 
  <td style="text-align:right;"><strong>Status ID:</strong></td>
  <td><input value="<%=c.getStatusID()%>" name="statusID" type="text" size="10" maxlength="30" disabled></td>
</tr>
<tr> 
  <td style="text-align:right;"><strong>Product ID:</strong></td>
  <td><input value="<%=c.getProductID()%>" name="productID" type="text" size="10" maxlength="25" disabled ></td>
</tr>
<tr>
  <td><br /></td>
</tr>
<tr>
  <td style="text-align:right;"><strong>In Service Date:</strong></td>
  <td><input value="<%=c.getInServiceDate()%>" name="inServiceDate" type="text" size="40" maxlength="25" disabled></td>
  <td style="text-align:right;"><strong>Out Service Date:</strong></td>
  <td><input value="<%= outOfServiceDate %>" name="outServiceDate" type="text" size="40" maxlength="25" disabled ></td>
</tr>
<tr>
  <td colspan= "4"></td>
<hr/>
</tr>
<tr>    
 <td>&nbsp;</td>
 <td><input name="Submit" type="submit" id="Submit" value="Home"></td>
</tr>
</table>
</form>


<script type="text/javascript" >

function validateForm()
  {
    var errorMessage = '' ;
    
	if ( '' == form1.locationID.value )
     { errorMessage += "\nLocationID required" ; }

	if ( '' == form1.room.value )
     { errorMessage += "\nroom required" ; }

	if ( '' == form1.statusID.value )
     { errorMessage += "\statusID required" ; }

     if ( '' != errorMessage )
     {
       alert( 'Please address the following:' + errorMessage ) ;
       return false ;
     }

   return true;
  }


</script>

<%@ include file="footer.jsp"%>
